package com.ss.jdk.stream;

import java.util.Optional;
import java.util.stream.Stream;

/**
 * @Auther: ljy.s
 * @Date: 2022/9/10 - 09 - 10 - 20:24
 */
public class StreamTest16Find {
    // 这是一个main方法，是程序的入口：
    public static void main(String[] args) {
        Optional<String> first = Stream.of("1", "2", "3", "4", "5", "6", "7").findFirst();
        System.out.println(first.get());

        Optional<String> any = Stream.of("1", "2", "3", "4", "5", "6", "7").findAny();
        System.out.println(any.get());
    }
}
